package cn.itsource.org.controller;

import cn.itsource.basic.util.AjaxResult;
import cn.itsource.org.domain.Shop;
import cn.itsource.org.service.IShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/shop")
public class ShopController {

    @Autowired
    private IShopService shopService;

    @PostMapping("storeHouse")
    public AjaxResult storeHouse(@RequestBody Shop shop) {
        boolean result = shopService.storeHouse(shop);
        return AjaxResult.toAjax(result);
    }

    /**
     * 店铺入驻
     */
    @GetMapping("/activation/{uuid}")
    public AjaxResult activation(@PathVariable String uuid) {

        //调用业务层
        boolean result = shopService.activation(uuid);
        //返回
        return AjaxResult.toAjax(result);
    }
}
